package com.shundr.shipper.common.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * 不可滑动的viewpager
 * StatementViewPager
 * 
 * @author larry 2015-6-27 下午1:57:12 
 * @version 1.0.0
 *
 */
public class StatementViewPager extends ViewPager{

	private boolean enabled;
	public StatementViewPager(Context context) {
		super(context);
	}
	 public StatementViewPager(Context context, AttributeSet attrs) {  
	        super(context, attrs);  
	    }  
	//触摸没有反应就可以了
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (this.enabled) {
            return super.onTouchEvent(event);
        }
  
        return false;
    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (this.enabled) {
            return super.onInterceptTouchEvent(event);
        }
 
        return false;
    }
 
    public void setPagingEnabled(boolean enabled) {
        this.enabled = enabled;
    }
}
